/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gla.centralhotel.dao.interfaces;

import gla.centralhotel.exception.CollectionRetrieverException;
import gla.centralhotel.exception.IllegalRoomNumberException;
import gla.centralhotel.model.Hotel;
import gla.centralhotel.model.Room;
import gla.centralhotel.model.RoomType;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.Local;

/**
 *
 * @author Rivo
 */
@Local
public interface IRoomDAO {

    void remove(Room room);

    public gla.centralhotel.model.Room find_(java.lang.Object id);

    public java.util.List<gla.centralhotel.model.Room> findAll_();
    
    /**
     * Recupere toutes les chambres d'un type
     * @param hotel
     * @return
     * @throws gla.centralhotel.exception.CollectionRetrieverException
     */
    public ArrayList<Room> getAllRoomByType(RoomType type) throws CollectionRetrieverException;
    
    /**
     * Recupere toutes les chambres d'un hotel
     * @param hotel
     * @return
     * @throws gla.centralhotel.exception.CollectionRetrieverException
     */
    public ArrayList<Room> getAllRoomByHotel(Hotel hotel) throws CollectionRetrieverException;

    /**
     * MAJ la chambre(id + num chbr) si le numero de l'hotel existe deja
     * Sinon ajouter la chambre
     * @param room
     * @return
     */
    public Room saveRoom(Room room) throws IllegalRoomNumberException;

}
